package com.controller;

import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.pojo.Archive;
import com.service.MohuQueryService;

@Controller
public class MohuQueryController {
	MohuQueryService service1 = new MohuQueryService();
     /*模糊查询*/
	@RequestMapping(value = "/mohuquery.action", method = RequestMethod.POST)
	@ResponseBody
	public List<Archive> mohuquery(
			@RequestParam(value = "archive_id", defaultValue = "") String archive_id,
			@RequestParam(value = "identity", defaultValue = "") String identity,
			@RequestParam(value = "name", defaultValue = "") String name,
			@RequestParam(value = "gender", defaultValue = "") String gender,
			@RequestParam(value = "birthday", defaultValue = "") String birthday,
			@RequestParam(value = "date_retire1", defaultValue = "") String date_retire1,
			@RequestParam(value = "date_retire2", defaultValue = "") String date_retire2,
			@RequestParam(value = "sp", defaultValue = "") String sp,
			@RequestParam(value = "fc", defaultValue = "") String fc,
			@RequestParam(value = "title", defaultValue = "") String title,
			@RequestParam(value = "seniority", defaultValue = "") String seniority,
			@CookieValue(value = "ID", defaultValue = "") String userId,
			HttpServletResponse response) {
		List<Archive> list = service1.mohuquery(archive_id, identity, name,
				gender, birthday, date_retire1, date_retire2, sp, fc, title,
				seniority);
		return list;
	}
}
